package org.hj.modules.act.procdef.service.impl;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.hj.modules.act.procdef.mapper.RuprocdefMapper;
import org.hj.modules.act.procdef.service.RuprocdefService;
import org.hj.modules.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/** 
 * 说明： 正在运行的流程接口实现类
 * 创建人：FH Q313596790
 * 官网：www.fhadmin.org
 */
@Service(value="ruprocdefServiceImpl")
@Transactional //开启事物
public class RuprocdefServiceImpl implements RuprocdefService {
	
	@Autowired
	private RuprocdefMapper ruprocdefMapper;
	

	/**待办任务 or正在运行任务列表
	 * @param
	 * @throws Exception
	 */
	public List<PageData> list(String KEYWORDS,String STRARTTIME,String ENDTIME,String USERNAME,String RNUMBERS)throws Exception{
		return ruprocdefMapper.getlistPage( KEYWORDS, STRARTTIME, ENDTIME, USERNAME,RNUMBERS);
	}
	
	/**流程变量列表
	 * @param page
	 * @throws Exception
	 */
	public List<Map> varList(String PROC_INST_ID_)throws Exception{
		return ruprocdefMapper.varList(PROC_INST_ID_);
	}
	
	/**历史任务节点列表
	 * @param page
	 * @throws Exception
	 */
	public List<Map> hiTaskList(String PROC_INST_ID_)throws Exception{
		return ruprocdefMapper.hiTaskList(PROC_INST_ID_);
	}
	
	/**已办任务列表列表
	 * @param page
	 * @throws Exception
	 */
	public List<PageData> hitasklist(Page page)throws Exception{
		return ruprocdefMapper.hitaskdatalistPage(page);
	}
	
	/**激活or挂起任务(指定某个任务)
	 * @param pd
	 * @throws Exception
	 */
	public void onoffTask(PageData pd)throws Exception{
		ruprocdefMapper.onoffTask(pd);;
	}
	
	/**激活or挂起任务(指定某个流程的所有任务)
	 * @param pd
	 * @throws Exception
	 */
	public void onoffAllTask(PageData pd)throws Exception{
		ruprocdefMapper.onoffAllTask(pd);;
	}

	@Override
	public void onoffAllTask(Integer STATUS, String ID_) throws Exception {
		ruprocdefMapper.onoffAllTask(STATUS,ID_);
	}

}
